Miles Sound System SDK 7.2a

Timer Services

Discussion

The Timer Services are used to provide cross-platform timer callbacks. Timers are implemented in different technology depending on the Miles platform:

Timer callbacks under Win32 and Win64 are implemented as background threads.

Timer callbacks under MacOS are implemented as MacOS system timers (which are interrupt based under MacOS 9 and thread based under MacOS X).

Timer callbacks under DOS are implemented as hardware interrupts.

Timer Services
AIL_ms_count returns a millisecond accurate timer count (one thousand ticks per second).
AIL_us_count returns a microsecond accurate timer count (one million ticks per second).
AIL_register_timer registers a callback function callback_fn to receive asynchronous time-slice service from a timer, and returns a handle HTIMER which may be used to start, stop, and program the function's assigned timer.
AILTIMERCB specifies a user-defined timer callback.
AIL_set_timer_user instructs the MSS timer dispatcher to pass the value user to the timer callback function associated with the timer handle timer.
AIL_set_timer_period programs a timer for callback service at periods ranging from 1 microsecond to 1,000,000,000 microseconds (approximately 15 minutes).
AIL_set_timer_frequency programs a timer for callback service at frequencies ranging from 1 Hz (Hertz, or cycles per second) to 1,000,000 Hz.
AIL_set_timer_divisor programs a timer for callback service at a rate which is given in terms of the constant value that would normally be used to program the IBM PC's 8253 Programmable Interval Timer chip for the desired interrupt rate, if the application were to access the chip directly.
AIL_interrupt_divisor returns the current value used internally by the Miles Sound System's Timer Services to program the IBM PC's 8253 Programmable Interval Timer chip for periodic INT 8 (IRQ 0) service.
AIL_start_timer initiates or resumes periodic time-slice interrupt service to the callback function registered to timer.
AIL_stop_timer stops periodic time-slice interrupt service to the callback function registered to timer.
AIL_release_timer_handle stops periodic time-slice interrupt service to the callback function registered to timer, and releases the timer's handle.
AIL_get_timer_highest_delay returns the highest delay in timer servicing under Win 32.
AIL_delay suspends foreground program execution.
AIL_lock suspends timer service to all MSS drivers and application callback functions until a matching call to AIL_unlock is made.
AIL_unlock resumes timer service to all MSS drivers and application callback functions after a matching call to AIL_lock.
AIL_start_all_timers initiates or resumes periodic time-slice interrupt service to the callback functions registered to all active timer handles.
AIL_stop_all_timers stops periodic time-slice interrupt service to the callback functions registered to all active timer handles.
AIL_release_all_timers stops periodic time-slice interrupt service to the callback functions registered to all active timer handles, and releases all active timer handles.

For technical support, e-mail Miles3@radgametools.com
© Copyright 1991-2007 RAD Game Tools, Inc. All Rights Reserved.